Repository navigation
Conversation
A request without MCP-Protocol-Version is treated as 2025-03-26, so servePOST accepted its JSON-RPC batch even when ServerOptions.SupportedProtocolVersions excluded every version before 2025-06-18, while the same batch with an explicit 2025-03-26 header was rejected as an unsupported version. Reject such batches with 400. Servers that still support 2025-03-26 or earlier keep accepting them. Fixes modelcontextprotocol#1513 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
This PR has been closed automatically. This repo only keeps pull requests open when they come from a maintainer, or from a contributor a maintainer has assigned to the linked issue, and you aren't currently assigned to #1513. You're welcome to keep pushing commits here (just avoid force-pushing, since GitHub can't reopen a rewritten branch), but that on its own won't get the PR reviewed or the issue assigned. There's no need to open a new PR either way. Maintainers: reopen, remove |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1513
A Streamable HTTP request without
MCP-Protocol-Versionis treated as 2025-03-26, so its JSON-RPC batch was accepted even whenServerOptions.SupportedProtocolVersionsexcluded every version before 2025-06-18. The same batch with an explicitMCP-Protocol-Version: 2025-03-26header is rejected as an unsupported version.servePOSTnow rejects such a batch with 400 when the server supports no version before 2025-06-18. Servers that still support 2025-03-26 or earlier, including the default configuration, keep accepting batches, and single messages without the header are unaffected.Covered by the new table test
TestStreamableServerBatchWithoutVersionHeader(stateful and stateless);gofmt,go vet,staticcheckandgo test -race ./...pass.I used Claude Code to help investigate this and write the patch; I reviewed the change and can explain it.
🤖 Generated with Claude Code